Conversion of longitudinal waves into electromagnetic radiation by a non-uniform plasma