Iraq’s electricity minister says he will resign after violent protests in several cities over chronic power shortages.