Effective potential for spin-boson systems and quasi-exactly solvable problems