Gravitational self-confinement of a photon beam