Islamic State claimed responsibility for an attack on an election rally in the Afghan province of Nangarhar on Tuesday, according to a statement on the group’s Amaq news agency.