Charmed quark component of the photon wave function