Harmonics generation and intense terahertz radiation from polar molecules at multiphoton resonant excitation in laser fields