An equivalent circuit for a two-state quantum system coupled to a single-mode electromagnetic cavity