Constraining anomalous Higgs boson couplings to virtual photons