We study an asset allocation problem for a defined-contribution (DC) pension scheme in its accumulation phase. We assume that the amount contributed to the pension fund by a pension plan member is coupled with the salary income which fluctuates randomly over time and contains both a hedgeable and non-hedgeable risk component. We consider an economy in which macroeconomic risks are existent. We assume that the economy can be in one of I states (regimes) and switches randomly between those states. The state of the economy affects the dynamics of the tradeable risky asset and the contribution process (the salary income of a pension plan member). To model the switching behavior of the economy we use a counting process with stochastic intensities. We find the investment strategy which maximizes the expected exponential utility of the discounted excess wealth over a target payment, e.g. a target lifetime annuity.