Israel, Palestinians accept midnight truce in Gaza