An algebraic approach to the Jaynes-Cummings model with dissipation