Oil prices closed little changed Friday, pulled between comments from President Donald Trump that high crude prices “will not be accepted” and a meeting between major oil producers where they recommitted to limiting output.

Light, sweet crude for May delivery settled up 9 cents, or 0.1%, at $68.38 a barrel on the New York Mercantile Exchange, hovering near their highest close in more than three years. Brent, the global benchmark, rose 28 cents, or 0.4%, to $74.06 a barrel.

Oil...