The splitting theorem for manifolds of nonnegative Ricci curvature