British MotoGP rider Cal Crutchlow will ride for Ducati next season after signing a two-year contract.