Exact solutions of the Schrödinger equation for the pseudoharmonic potential: an application to some diatomic molecules