Stocks closed modestly higher on Wednesday, reversing earlier losses, as investors brushed off ongoing turmoil in Egypt and political uncertain in Portugal and squared positions ahead of the holiday Thursday and jobs report due out Friday morning.

All U.S. markets are closed Thursday for the Fourth of July holiday.