The Dow Jones industrial average pared back gains after trading in record territory Wednesday, helped by blue-chip energy companies and banks.

Oil stocks climbed after OPEC nations, which collectively produce more than one-third of the world’s oil, agreed to trim production for the first time in eight years. Banks are also rising sharply as bond yields and interest rates increase.

Other U.S. indexes are little changed or lower as high-dividend stocks like utilities, real estate companies and phone companies fall. Technology and health care companies were also taking losses.

ON WALL STREET: At midafternoon, the Dow was up 30.2 points, about 0.2 percent, at 19,151. The Standard & Poor’s 500 index fell 2.9 points, about 0.1 percent, to 2,202.2, and the Nasdaq composite was off 51.4 points, about 1 percent, to 5,328.2.

OIL WATCH: OPEC members finalized a deal that will cut their oil output by 1.2 million barrels a day starting in January. Preliminary terms of the deal among members of the Organization of Petroleum Exporting Countries were announced in September. It’s the first time in eight years that the cartel has agreed to cut production. Russia, another major oil-producing country that is not part of OPEC, also agreed to cut its output. At midafternoon benchmark U.S. crude was up $3.93 cents to $49.16 a barrel in electronic trading on the New York Mercantile Exchange. In London on the Intercontinental Exchange Europe, Brent crude, used to price international oils, rose in volatile trading $3.99 to $50.37 a barrel.

ENERGY COMPANIES: Higher oil prices mean more revenue for companies that extract or sell oil, and energy companies made big gains Wednesday. Exxon Mobil picked up $2.07, or 2.4 percent, to $87.96 and Chevron rose $3.03, or 3 percent, to $112.36.

More specialized oil companies, particularly drillers and oil exploration companies and companies who support drillers, soared. Marathon Oil leaped $3, or 20 percent, to $17.95. Ocean rig operator Transocean jumped $2.05, or 19 percent, to $13.07.

advertisement | advertise on newsday

BANKS: Banks rose as members of President-elect Donald Trump’s economic team discussed ways to make it easier for banks to lend more money, which could lead to larger profits for financial institutions. Steven Mnuchin, Trump’s proposed nominee for Treasury secretary, said the administration wants to make changes to the 2010 Dodd-Frank law because it makes it harder for banks to lend. The law was passed to prevent another financial crisis, but critics say it went too far and stopped banks from making loans that people and businesses need to spend and hire.

Goldman Sachs rose $7.05, or 3.3 percent, to $218.76 and JPMorgan Chase added $1.08, or 1.4 percent, to $80.08. Fifth Third Bancorp gained 66 cents, or 2.6 percent, to $26.05.

BLUE CHIPS CASH IN: The gains were concentrated among a small number big-name companies. Goldman Sachs and Chevron alone accounted for all of the gain in the Dow, which contains just 30 stocks. On the New York Stock Exchange, more stocks were falling than rising.

BONDS: Bond prices fell. The yield on the 10-year Treasury note jumped to 2.37 percent from 2.29 percent, its highest level since mid-2015. Bond yields are linked to higher interest rates.

High-dividend stocks slumped. Investors who want income tend to buy those stocks when bond yields are low and then sell them again when bond yields rise.

Utilities, real estate investment trusts and phone companies took the largest losses on the market.

TECH TRIPPED UP: Technology companies were in decline. Design software company Autodesk dropped $2.86, or 3.8 percent, to $72.40 after it gave a weak revenue outlook for the current quarter. Credit card companies fell, too. Visa dipped $1.20, or 1.5 percent, to $77.95 and MasterCard skidded $1.48, or 1.4 percent, to $102.34.