Effect of a nanoparticle on the optical properties of a photonic crystal cavity: Theory and experiment