Gaza militant groups agree Israel ceasefire, says Hamas