Mixing of terahertz and near-infrared radiation in quantum wells in strong magnetic fields