MOSCOW (Reuters) - Doing business in Russia became easier over the past year but Moscow needs to work on increasing competition in the economy, the World Bank said on Tuesday.

Russia advanced to 40th of 190 countries in the World Bank's 2017 business rankings from 51st in 2016, between Bulgaria and Hungary and closer to an ambitious target set by President Vladimir Putin to enter the top 20 by the end of the decade.

"In past years, Russia has been active in reforming across multiple areas of business regulation," said Andras Horvai, World Bank Russia Country Director.

"In some aspects of Doing Business, the business regulatory environment of Russia is now closer to best practice."

The World Bank noted that Russia is doing well when it comes to registering property and enforcing contracts. Dealing with construction permits also became easier over the past year.

But Russia still has room to improve, particularly by increasing competition in the economy, he said.

The highest-ranked country for ease of doing business was New Zealand, while Somalia came in last, the World Bank said.

Despite an economic crisis and geopolitical tensions with the West, Russia has been climbing the rankings in recent years.

The Doing Business study focuses on regulation that affects small and medium-size enterprises across 11 areas. These include starting a business, dealing with construction permits, getting electricity, registering property, getting credit, protecting minority investors, paying taxes, trading across borders, enforcing contracts, and others.

(Reporting by Andrey Ostroukh; Editing by Catherine Evans)