BRASILIA (Reuters) - Brazil's growing prosperity is allowing teenagers to stay in school for longer instead of searching for jobs to support their families, boosting the country's long-term prospects but also causing some economic headaches.

The shift helps explain one of the biggest debates among economists who follow Brazil - why unemployment remains at record lows of about 5 percent despite slow economic growth.

A Reuters analysis of unemployment data found that the share of working-age people "not willing to work" in Brazil's six major cities has jumped by 6 percentage points to 39 percent since 2002.

That is equivalent to about 2.5 million people who have opted out of the labor force. By comparison, roughly the same number of Brazilians are classified as unemployed.

The case of Mariane Soares, 18, helps explain the shift.

Her mother, a teacher, was one of six siblings - which used to be typical in Brazil. Instead of following her dream of studying at the University of Brasilia (UNB), one of the country's most prestigious public universities, she took a job right out of high school to pay her bills.

Soares, by contrast, is an only child, and received the full attention and financial support of her parents, common in today's Brazil. She is currently studying to take the UNB's admission exam, hoping to become a political scientist.

"Today, these parents that had to work early say: Now that I can help you, I'll definitely do that," Soares told Reuters during a recent conversation with 11 other students aged between 17 and 26, many of whom had similar stories.

Such changes are generally great news for the younger generation. Although a decade of strong economic expansion has given way to growth averaging just 2 percent in the last three years, most Brazilians say they are happy with the economy, and that is helping President Dilma Rousseff's bid for re-election this October.

Overall, unemployment has fallen from 12.9 percent in 2002 to 5.1 percent today, according to the last official data in February.

The quest for a better education will, in the long term, help Brazil address its recent problems with falling productivity.

But in the short term, the struggle to find and retain qualified workers has forced companies to pay ever-higher wages, hurting their bottom lines and driving persistently high inflation of around 6 percent.

"Brazil used to have an abundant workforce. Now, we are a story of scarce labor," said former central banker Affonso Celso Pastore, partner at AC Pastore & Associados consultancy.

Few Workers, Little Growth

Education was for many years a secondary priority in Brazil, as successive financial crises and the need for jobs and food demanded people's attention. As recently as the 1950s, only one in three children attended school at all.

Reforms began to stabilize the economy in the mid-1990s. Starting in 2001, the government started paying families a monthly stipend for keeping their children in school. A broad education reform allowed millions to join private universities and, recently, even go to foreign schools with government incentives.

As a result, it is easy to find students saying they'll be backed by their parents and stay out of the labor market until finishing college at age 23 or 24, five or even 10 years older than their parents when they first started working.

"The desire to study in a federal university stands out. We're all putting off the dream of building our own family a little bit," said Monalisa Feitosa, 18, who plans to be a dentist in Brasilia.

Economists say other explanations for Brazil's low unemployment rate include the so-called "hoarding" of skilled labor, as companies bet the economy will revive soon and choose not to fire workers in the meantime, for fear of losing them to competitors.

The soccer World Cup, which starts on June 12, is also often cited by economists, since several companies will need extra workers to deal with an expected influx of 600,000 foreign tourists.

Some Brazilians believe that welfare programs implemented last decade have reduced the incentive for poorer people to work, although academic studies have indicated that is false.

Whatever the causes, scarce labor may be an issue in Brazil for years to come. Even as more college-trained workers arrive in the labor market, economists point out that the number of workers will continue to grow at a very slow pace because of the smaller number of children. In just 25 years, Brazil's population is expected to start declining.

Still, such concerns seem largely academic to students like Maria Laura Cordeiro, 18, who says she'll continue to pursue a college degree - even in the unlikely event that water or energy rationing tip Brazil's economy into recession in coming months.

"If that happens, I'll work in my free time, day or night," she said. "I'll live on energy drinks if I need, but I won't let it go. It's my dream and I'll go until the end."