Convergence of spectral methods for nonlinear conservation laws