Toto Wolff insists there is no doubt Lewis Hamilton will sign a new contract and remain with Mercedes for the foreseeable future after admitting the delays were due to the team focusing on improving the car after a poor start to the season.

The British driver is out of contract at the end of the 2018 season and is yet to agree a new deal despite being in talks since the end of last season. It was expected to be done before the start of the current campaign, but it has dragged on with the season now five races old.

The Mercedes team principal revealed that all the details are almost sorted, but they had to put talks on a back burner to focus on turning their season around after seeing Ferrari and Red Bull Racing be stronger than them in the first four races of the season.

The Italian team won the first two races of the campaign with Red Bull winning the third in China. Mercedes won the fourth race in Azerbaijan, but it was clear that it was surrounding circumstances that helped them win.

Lewis Hamilton Lewis Hamilton is leading the F1 drivers' championship by 17 points from Sebastian Vettel. In this picture, Race winner Lewis Hamilton of Great Britain and Mercedes GP celebrates on the podium during the Spanish Formula One Grand Prix at Circuit de Catalunya in Montmelo, Spain, May 13, 2018. Photo: Charles Coates/Getty Images

There were talks about the tide turning in Ferrari’s favor prior to the Spanish Grand Prix, but Mercedes returned to the top step of the podium with a dominant display from Lewis Hamilton, who looked unassailable during the race.

Wolff is confident that both the driver and the team are committed to each other and is certain they can get it sorted out sooner rather than later, especially since they got back to winning ways at the Circuit de Catalunya.

“Obviously we don't want to lose him and I don't think he wants to go anywhere else. Everything's going fine,” Wolff told reporters during the Barcelona Grand Prix, as quoted by the Daily Mail. “There's no reason why we shouldn't be racing with each other for a few more years. We had other priorities in the last few weeks. We weren't happy with our cars' performance and we needed to sort it out.

“And finalising a contract is something you need to involve yourself in and spend time and we both decided that we'd park it for a minute where we were. But it's almost all sorted and we'll pick it up at the right time,” the Mercedes chief added.

Meanwhile, despite Hamilton being confirmed for the 2019 season, there remains a question mark on his teammate for next season. Wolff indicated earlier that they will look for options within the Mercedes family rather than look at someone like Daniel Ricciardo, who is out of contract with Red Bull.

However, he has changed his stance and confirmed that despite the team possessing good drivers in Valtteri Bottas – Hamilton’s current teammate – and good young drivers in Esteban Ocon and George Russell, they are looking at Ricciardo as a potential candidate.

Hamilton has endorsed Bottas for a long-term role at Mercedes and Wolff also admitted he is on par with the four-time F1 drivers’ champion this season, but the team will make a decision on the second driver in the summer.

“I was not translated correctly,” Wolff said referring to him dismissing Ricciardo’s chances of driving for Mercedes, as quoted on Planet F1. “I only said that we are loyal first of all to our drivers. They are Lewis, Valtteri and the Mercedes young drivers. They come first. If we were to look at others, Daniel is definitely among them."

“Valtteri deserved to win in Baku and could even have won the last two. It is very balanced between him and Lewis at the moment,” the Austrian explained.