June 29 (Reuters) - The S&P 500 and the Dow Jones Industrial Average were set to open slightly higher on Thursday as banks gained after the Federal Reserve cleared them in the second part of its annual stress test program.

Shares of the top six U.S. banks rose in premarket trading on Thursday after the Fed's decision, which allows them to raise dividend payouts and share buybacks.

"The banks will be in the spotlight today as all of the U.S. banks passed the stress test setting the stage for the indices to hold on to Wednesday's gains," said Peter Cardillo, chief market economist at First Standard Financial in New York.

Wall Street rallied sharply on Wednesday, with the benchmark S&P 500 index scoring its biggest one-day percentage gain in about two months, as financial and technology stocks led a broad market rebound.

The Nasdaq posted on Wednesday its best session since Nov. 7, the day before the U.S. presidential election.

Tech stocks, which have led the S&P 500's 9-percent gain this year, pulled back recently as some investors questioned the sector's high valuations.

Oil prices rose to a two-week high on Thursday, extending a rally into the sixth straight session, after a decline in weekly U.S. production eased concerns about deepening oversupply.

Cardillo said end-of-the-quarter window dressing and an optimistic global outlook should make for a steady-to-positive session.

The markets were little changed after data showed the U.S. economy slowed less sharply in the first quarter than initially estimated due to unexpectedly higher consumer spending and a bigger jump in exports.

The number of Americans filing for unemployment benefits edged up last week, but the underlying trend remained consistent with a tight labor market.

Walgreens Boots Alliance was up 4 percent after it terminated agreement to buy Rite Aid Corp and said it would instead buy nearly half of Rite Aid's stores for $5.18 billion. (Reporting by Ankur Banerjee in Bengaluru; Editing by Arun Koyyur)