A general methodology is described in which policyholder behaviour is decoupled from the pricing of a variable annuity based on the cost of hedging it, yielding two sequences of weakly coupled systems of partial differential equations (PDEs): the pricing and utility systems. The utility systems are used to generate policyholder withdrawal behaviour, which is in turn fed into the pricing systems as a means to determine the cost of hedging the contract. This approach allows us to incorporate the effects of utility-based pricing and factors such as taxation. As a case study, we consider the Guaranteed Lifelong Withdrawal and Death Benefits (GLWDB) contract. The pricing and utility systems for the GLWDB are derived under the assumption that the underlying asset follows a Markov regime-switching process. An implicit PDE method is used to solve both systems in tandem. We show that for a large class of utility functions, the two systems preserve homogeneity, allowing us to decrease the dimensionality of solutions. We also show that the associated control for the GLWDB is bang-bang, under which the work required to compute the optimal strategy is significantly reduced. We extend this result to provide the reader with sufficient conditions for a bang-bang control for a general variable annuity with a countable number of events (e.g. discontinuous withdrawals). Homogeneity and bang-bangness yield significant reductions in complexity and allow us to rapidly generate numerical solutions. Results are presented which demonstrate the sensitivity of the hedging expense to various parameters. The costly nature of the death benefit is documented. It is also shown that for a typical contract, the fee required to fund the cost of hedging calculated under the assumption that the policyholder withdraws at the contract rate is an appropriate approximation to the fee calculated assuming optimal consumption.