The effect of gain and absorption on surface plasmons in metal nanoparticles