The prime minister was today forced to defend the decision to appoint his "personal photographer" to a civil service post responsible for recording the coalition in government after coming under attack from Ed Miliband.

Andrew Parsons, who documented David Cameron's election campaign while being paid by the Conservative party, is now a government employee earning an undisclosed salary. The Labour leader challenged Cameron at prime minister's questions today to defend the appointment at a time when everyone else was being told to "tighten their belts".

Parsons is one of at least a dozen Tory party employees who have been appointed to the civil service on short-term contracts. All civil service jobs are supposed to be non-party-political and employees must abide by a code of conduct dictating that they must act in an impartial way.

Other appointments since the election include Chloe Dalton, an adviser to William Hague in opposition, who has been drafted into the Foreign Office as a civil servant. Two speechwriters to Cameron before the election, Ameetpal Gill and Clare Foges, have paid civil service jobs in Downing Street.

Sam Freedman, who helped devise the Tories' free schools policy in opposition, has been made an adviser on the civil service payroll in the DfE.

Rishi Saha, an internet expert who was head of digital strategy for the Conservatives, has been appointed deputy director of digital communications at the Cabinet Office. Earlier this year it emerged that in at least two cases the Cabinet Office conduct and ethics department was asked to vet the appointments and passed them. Downing Street sources have claimed that Labour used the same loophole to appoint its party members in 1997.

Miliband asked Cameron in the Commons today: "Is it really a wise judgment when he is telling everyone to tighten their belts to put his own personal photographer on the civil service payroll?"

Cameron responded that his government was slashing Labour's spending on communications and publicity.

A spokesman for the Cabinet Office confirmed Parsons's appointment, but said he could not comment further. "There is long-standing provision within the recruitment rules for departments to bring in staff on short-term contracts," he said. "While employed as a civil servant they are subject to the full requirements of the civil service code, including political impartiality. There are also strict rules about involvement in political activities.

"Civil servants come from a range of backgrounds and employment. What's important is that when individuals are working for us their behaviour is consistent with the civil service code."