Terahertz radiation from optical rectification of a modulated laser pulse