Quantum Treatment of Amplified Spontaneous Emission in High-Gain Free-Electron Lasers