The Dow Jones Industrial Average's march to 20,000 proved a challenge in the new year as stocks more than halved earlier gains by Tuesday afternoon.

The Dow gained 0.3% to 19,823 after coming within 60 points of the 20,000 milestone earlier in the session. Late last year, the Dow crept to within 15 points of the psychologically significant level. The S&P 500 was up 0.56% on Tuesday, while the Nasdaq rose 0.54%.

Crude oil made a surprise turn lower on Tuesday as hopes that a production cut among some of the world's largest oil producers would significantly rebalance prices began to fade. Crude had risen above $55 a barrel earlier as an agreement between Organization of Petroleum Exporting Countries to curb output took effect. OPEC member nations and 11 non-OPEC producers, including Russia, agreed to curb production by about 1.8 million barrels a day. However, there are concerns that some countries may find it difficult to adhere to restrictions with production currently at record highs.

West Texas Intermediate crude settled 2.6% lower at $52.33 a barrel on Tuesday, its lowest level in more than two weeks.

The energy and basic materials sectors were among the best performers Tuesday. Energy stocks including Marathon Petroleum (MPC - Get Report) and Halliburton (HAL - Get Report) climbed, while the Energy Select Sector SPDR ETF (XLE - Get Report) added 0.9%. Materials stocks such as United States Steel (X - Get Report) and Barrick Gold (ABX) rose. 

U.S. manufacturing activity expanded in December. The U.S. ISM manufacturing index increased to 54.7 in December, a two-year high, up from 53.2 the month earlier. Production and new orders both rose to above 60 for the first time since 2014. A separate reading on manufacturing from Markit showed the purchasing managers' index at a 21-month high.

U.S. construction spending also surged at the end of last year, hitting a more than 10-year high in November. The metric rose by 0.9%, above estimates that called for a 0.6% increase.

Chinese manufacturing activity expanded for the sixth consecutive month. The China Caixin manufacturing purchasing managers' index increased to 51.9 in December from 50.9 a month earlier. The increase was the metric's fastest rise since January 2013. China's Shanghai Composite increased by 1%, while the Hang Seng in Hong Kong rose 0.7%.

The Dow gained 13.5% in 2016, while the S&P 500 rose 9.4% and the Nasdaq added 7.5%. The Dow received a big boost in the final two months of the year as investors placed bets that a Donald Trump administration would yield higher infrastructure spending. The blue-chip index rocketed higher after the November election that saw an unexpected victory for President-elect Trump.

Twitter (TWTR - Get Report) lost another of its executive team after Kathy Chen, head of operations in China, announced her resignation. Twitter, which is blocked in the region, mainly sought to seduce Chinese advertisers looking for a global audience. The company's Greater China advertiser base rose nearly 400% over the past two years. 

Intel (INTC - Get Report) has acquired a 15% stake in HERE, a German company that focus on digital mapping. The tech company said the two would work together to produce real-time high-definition mapping technology. 

Xerox (XRX - Get Report) jumped more than 14% after Credit Suisse upgraded its rating to outperform from neutral. Analysts pointed to increased cost savings and a focus on printing as cause for optimism. Credit Suisse said management had realistic plans to move the "business away from mature declining markets to growth segments such as graphics and Managed Print Services."

Analysts at Nomura picked Starbucks (SBUX - Get Report) as their top restaurant pick for 2017. The firm pointed to easier sales comparisons this year that could entice investors back to the stock.

Starbucks is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells SBUX? Learn more now.

Shares of General Motors (GM - Get Report) rose after falling in premarket trading. Earlier, President-elect Donald Trump slammed the automaker for manufacturing its Cruze vehicle in Mexico, demanding payment of a "big border tax" on imports.

Ford  (F - Get Report) announced plans to cancel a new $1.6 billion plant in Mexico. The automaker will instead invest $700 million in Michigan to expand existing facilities. The stock rose more than 3%.

Kansas City Southern (KSU - Get Report) slumped on the news. The Mexico plant would have been built along one of the railway company's routes. Industry peers also fell, including Norfolk Southern (NSC - Get Report) and Union Pacific (UNP - Get Report) . 

Depomed (DEPO) surged 10% on reports KKR is seeking a potential acquisition. Final bids for the company will be received by Wednesday.

Abercrombie & Fitch (ANF - Get Report) moved 1% lower after a series of downgrades. Oppenheimer reduced its rating to underperform and Jeffries cut to hold from buy. The apparel retailer slumped more than 50% over 2016.

Groupon (GRPN - Get Report) increased 4% after RBC Capital upgraded the stock to sector perform from underpeform. The firm said the move was largely based on valuation.

Xilinx (XLNX - Get Report) was downgraded to reduce from neutral at Nomura. The firm said its valuation was less attractive as the company is valued at 26 times expected earnings. The stock declined 3%.