Eurozone businesses grew more optimistic about their prospects in May, an indication that they may increase investment despite the continued deadlock in negotiations between Greece and its creditors that has raised fresh questions about the coherence of the currency area.

Four months after taking power, Greece's left-wing government has yet to seal an agreement on economic reforms with the rest of the eurozone and the International Monetary Fund that would enable it to repay its debts.

Speaking Wednesday in London, U.S. Treasury chief Jacob Lew said it would be wrong to assume that a disorderly Greek exit from the eurozone would be painless.

"No one should have a false sense of confidence that they know what the risk of a crisis in Greece would be," Mr. Lew said in an address to students at the London School of Economics.

During previous bouts of uncertainty about Greece's membership of the eurozone, or the ability of other members to meet debt payments, business confidence has suffered. That hasn't happened in 2015, an indication that the nation's troubles are so far having a limited impact on the wider eurozone economy.

In its monthly survey of sentiment in households and businesses across the currency area, the European Commission recorded a pickup in confidence measures among manufacturers, service providers, retailers and construction companies.

By contrast, consumers became slightly less optimistic about the economic outlook and their job prospects during the month, but remained more upbeat than they typically have been in the seven years since the financial crisis erupted.

The commission's headline Economic Sentiment Indicator—which aggregates the business and consumer measures—was unchanged at 103.8, its highest level since mid 2011 and well above the average of 100.0 going back to the start of the series in 1990.

The resilience of confidence will come as a relief to policy makers, who see weak investment as a key impediment to a faster recovery in the eurozone, and fear that years of low growth as the financial crisis morphed into the eurozone's own debt crisis has made businesses and households less willing to take risks and embark on long-term projects.

The surveys contained other sources of encouragement for the European Central Bank, which in March launched a program of more than one trillion euros in purchases of mostly government bonds that is intended to raise inflation to its target of just below 2.0%.

The surveys found that consumers and service providers expect prices to rise more rapidly over the next 12 months than they did in April, while manufacturers expect the fall in prices to be more modest.

Write to Paul Hannon at paul.hannon@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires