Optimality of the uniform rule under single-peaked preferences