Daimler is to take a stake of up to 5% in Aston Martin as part of a technical tie-up between the British sports car maker and AMG, the performance division of Mercedes-Benz.