The United Nations agreed on Friday that all members should pass and enforce laws banning child marriages, resolving to end a practice that affects about 15 million girls every year.