More than 4,000 people, a quarter of them civilians, were killed in violence in Afghanistan last year, the bloodiest period since a U.S.-led coalition overthrew the Taliban in 2001.