Hess Corp. (NYSE: HES) reported a smaller quarterly loss as a rise in oil prices and fall in costs helped the U.S. oil producer offset a drop in production.

Hess shares were marginally up at $49 before the bell in light premarket trading on April 26.

Excluding output from Libya, Hess produced 307,000 barrels of oil equivalent per day (boe/d) in the first quarter ended March 31, lower than 350,000 boe/d a year ago.

Hess said lower production volumes in the quarter partly stemmed from a "reduced drilling program."

The company had earlier this year set a higher spending target for 2017 and said it would expand in the U.S. Gulf of Mexico, Thailand and Guyana and ramp up drilling in North Dakota's Bakken Shale.

A more than 41% rise in Hess's average realized crude oil selling price in the quarter, including the effect of hedging, helped the company make up for the fall in production.

Oil prices began to rise late last year after a two-year slump and have now stabilized at above $50 per barrel (bbl), as an OPEC-led production cut and rebounding demand slowly erode a global glut.

West Texas Intermediate crude prices averaged $51.78/bbl in the first three months of the year, up 54% from a year earlier.

Hess said total revenue and nonoperating income rose 28.4% to $1.28 billion in the quarter, while total costs and expenses fell 13.3% to $1.58 billion.

Lower oilfield costs have helped U.S. oil producers keep a lid on spending and enabled them to keep drilling during the downturn.

Net loss attributable to Hess narrowed to $324 million, or $1.07 per share, in the quarter, from $509 million, or $1.72 per share, a year earlier.