The deal also has a one-year option, which could keep Valencia - who is currently on World Cup duty - at Old Trafford until June 2018.
Valencia told the club's website: "My time at Manchester United has been like a dream come true. To be the first Ecuadorian player to win the English Premier League was a very proud moment for me and for my country."