Four children were among six killed when a school being used to house displaced people in Gaza City came under attack.