Generation of broadband terahertz radiation in a phase-matched waveguide geometry