Afghan presidential rivals reach deal, brokered by Kerry, to recount all votes