The United Nations has criticized a new Afghan law on separation in marriage, saying it entrenches discrimination against women and girls.