The Israeli government and Palestinian militants have agreed to extend the ceasefire in Gaza by another five days.