Mick Schumacher has joined Mercedes as reserve driver after Ferrari ended their four-year affiliation with him.