Leaders of the bloc of West African states known as ECOWAS have agreed on a plan for military intervention in Niger unless coup leaders restore civilian rule by Sunday.