Technology companies helped drive U.S. stocks higher in afternoon trading Wednesday, adding to the sector's market-leading gains this year. Banks also rose as bond yields inched higher. Energy stocks got a boost from the price of crude oil, which climbed back above $70 a barrel a day after the U.S. moved to withdraw from a nuclear accord with Iran.

KEEPING SCORE: The S&P 500 index rose 22 points, or 0.8 percent, to 2,694 as of 1:22 p.m. Eastern Time. The Dow Jones industrial average gained 158 points, or 0.7 percent, to 24,519. The Nasdaq added 53 points, or 0.7 percent, to 7,320. The Russell 2000 index of smaller-company stocks picked up 8 points, or 0.5 percent, to 1,594.

ENERGY: Oil prices rebounded a day after the Trump administration moved to withdraw the U.S. from a 2015 nuclear accord with Iran and reinstate sanctions on the country. Benchmark U.S. crude oil climbed $2, or 2.9 percent, to $71.06 per barrel in New York. That's the highest level in nearly three and a half years. Brent crude, which is used to price international oils, gained $2.11, or 2.8 percent, to $76.96 per barrel in London.

The pickup in oil prices sent energy stocks higher. Occidental Petroleum gained 5.3 percent to $82.32.

ON THE ROAD: TripAdvisor soared 22.7 percent to $47.60 after the online travel booking company reported earnings that were much higher than analysts expected. It also raised its annual forecast.

GAME ON: Electronic Arts led a technology sector rally, climbing 5.9 percent to $131.25 after the video game maker's latest quarterly results beat forecasts.

BIG GETS BIGGER: Walmart Stores slid 3.3 percent to $82.88 after the retailer agreed to buy a 77 percent stake in India's Flipkart in a $16 billion deal. The move is Walmart's biggest acquisition yet and reflects the retailer's focus on growth opportunities as it tries to narrow the gap with Amazon.com.

FIZZLED: Monster Beverage slumped 7.4 percent to $49.14 after the energy drink maker reported disappointing sales in the first quarter and said its profit margins decreased.

MOUSE TRAPPED: Walt Disney fell 1.5 percent to $100.23 after the entertainment giant released quarterly results that, while better than analysts had expected, showed that its ESPN network continued to struggle.

WEAK SAUCE: Papa John's International dropped 3.9 percent to $56.46 after the pizza chain's first-quarter results fell short of analyst estimates.

BOND YIELDS: Bond prices fell. The yield on the 10-year Treasury rose to 3 percent from 2.98 percent late Tuesday. The rise in yields pushed up interest rates, which allows banks to make more money from loans. Financial sector stocks rose. Bank of America gained 2.3 percent to $30.63.

CURRENCIES: The dollar rose to 109.67 yen from 109.02 on Tuesday. The euro weakened to $1.1856 from $1.1858.

MARKETS OVERSEAS: In Europe, Germany's DAX rose 0.2 percent and France's CAC 40 gained 0.2 percent. Britain's FTSE 100 added 1.3 percent. In Asia, Japan's Nikkei 225 dropped 0.4 percent and South Korea's Kospi fell 0.2 percent. Hong Kong's Hang Seng index added 0.4 percent. Australia's S&P/ASX 200 gained 0.3 percent. Stocks rose in Taiwan, Singapore and Indonesia, but fell in Thailand and the Philippines.