U.S. stocks rose modestly on Wednesday as energy-related shares rose for a third straight session and data pointed to improving conditions in the U.S. services sector, which makes up a majority of the economy.

Market moves were slight, with many traders looking ahead to a key meeting of the European Central Bank. Still, the Dow hit an intraday record and the S&P neared its own record, set last week.

The S&P 500 energy sector rose 0.7 percent, outperforming both the broader market and crude oil, which continued to struggle. Cimarex Energy was one of the S&P 500's top gainers, up 4.3 percent at $107.32. Diamond Offshore rose 3.1 percent to $31.29.