Former Atletico Madrid and Uruguay defender Diego Godín has retired from all forms of football at the age of 37.