The UN Security Council has adopted a resolution calling for an immediate and durable ceasefire between Hamas militants and Israeli forces in Gaza.