Space-charge effects in a free-electron laser with a two-frequency undulator