Interaction of terahertz transients and broadband optical pulses in quantum wells