Quantum theory of Josephson radiation