Ducati and Bagnaia agree two-year contract extension