Effective Hamiltonians in the quantum Rabi problem