The Mercedes driver won despite a 10-second penalty for a controversial first lap collision that sent Red Bull rival Max Verstappen crashing out of the race.
Mercedes' seven-time world champion Hamilton finished a distant fourth, with teammate Valtteri Bottas second and McLaren's Lando Norris third, as Red Bull chalked up their fifth win in a row.
The new deal covers 2022 and 2023.
Verstappen led from start to finish at Austria's Red Bull Ring, with seven-time world champion Hamilton second for Mercedes.
The 23-year-old, now level with Hamilton on three wins for the season, also set the fastest lap and has 131 points to Hamilton's 119.
A tyre blowout denied Max Verstappen victory and Lewis Hamilton failed to score.
The 23-year-old Dutch driver started the day 14 points behind Mercedes' seven-time world champion Hamilton and ended it four clear.
The team of four-time world champion Sebastian Vettel and Lance Stroll said in a statement on Wednesday that she will work with partners and "across a variety of disciplines".
The Briton's 98th career victory, from his 100th pole position, was his third win in four races and sent him 14 points clear of Red Bull's Max Verstappen.
Verstappen finished second at the Algarve circuit with Mercedes' Valtteri Bottas completing the podium, and taking a bonus point for the fastest lap, after starting from pole position.