Australian shares closed higher on Thursday thanks to a surge in energy stocks after a surprise OPEC agreement to trim production. The energy index posted its biggest intraday percentage gain in over 7-1\/2 years, mirroring the global impact on oil firms stemming from the OPEC deal. The S&P\/ASX 200 index ended 1.1 percent higher, or 58.95 points at 5,471.3, with sentiment also getting a boost from data showing a strong rebound in Australian job vacancies. Beach Energy Ltd soared as much as 13.3 percent to its highest in three months, while Santos Ltd rose 10 percent, its biggest percentage gain in 5 months. Mining giants BHP Billiton and Rio Tinto gained 3-5 percent, tracking 2 percent gains in iron ore futures in China on Wednesday. New Zealand's benchmark S&P\/NZX 50 index extended gains for a second session and closed 0.7 percent or 53 points higher, to 7,343.45. The rally was led by healthcare stocks. Medical device maker Fisher & Paykel Healthcare Corp rose 2.85 percent, its highest in a month.