Terahertz luminescence of GaAs-based heterostructures with quantum wells under the optical excitation of donors