Nabors Industries rallied 7% on Wednesday, helping energy stocks to buck the market trend and edge higher.