Lewis Hamilton has signed a new two-year contract with Mercedes, running until the end of the 2023 Formula One season.