The UN has decided to temporarily remove 600 of its staff members from Afghanistan after an attack by militants on one of its Kabul facilities killed five and wounded nine.