Spectral clustering in the weighted stochastic block model