Spectral modification of laser-accelerated proton beams by self-generated magnetic fields