Generation of wakefields and terahertz radiation in laser-magnetized plasma interaction