Terrorism, factionalism rife in Afghanistan: UN official