Superintegrability on N-dimensional spaces of constant curvature from so(N + 1) and its contractions