Frequency dependence of induced spin polarization and spin current in quantum wells