Tito Vilanova has agreed to a two-year contract as new coach of Barcelona, and will sign the deal Friday.

The 42-year-old was an assistant under former coach Pep Guardiola for the last four seasons. Guardiola ended his tenure last month after winning 14 trophies.

Vilanova played in Barca's youth ranks, but failed to break through with the first team. He played for a number of clubs during his career, including Celta and Mallorca.

He retired as a player in 2002, and returned to Barcelona in 2007 with Barca's B side. He was promoted to first-team assistant in 2008.

Vilanova was previously revealed as the replacement for Guardiola, but had yet to agree to a contract.