Fernando Alonso will race for Aston Martin in 2023, signing a multi-year deal with the team to replace Sebastian Vettel.