Number-conserving approximation to the shell model