Quantum mechanics on the noncommutative plane and sphere