Quantum theory of the traveling-wave frequency converter