Hartree theory for rovibrational states of molecules