Why do we use the contracted form here?
The word de' you have found is a truncated version of "preposizione articolata" dei.
Section IV.80 of the book Italiano by Luca Serianni gives detailed information about the truncated versions of this and other Italian "preposizioni articolate", namely
a' (<ai), co' (<coi), da' (<dai), de' (<dei), ne' (<nei).
They were typical of the literary tradition until the end of the XIX century and beyond and of literary works that intended to mimic Tuscan language. Here you can find some examples from Leopardi and Carducci. It's also explained that Manzoni changeg the above mentioned "preposizioni articolate" in these truncated versions when he did the revision of I Promessi Sposi because these were the forms used in the Florentine language of that time. But they are not used anymore nowadays in standard Italian:
Antiquate anche le forme di plurale maschile con apocope postvocalica: a' (<ai), co' (<coi), da' (<dai), de' (<dei), ne' (<nei), proprie della tradizione letteraria fino a tutto l'Ottocento ed oltre e della prosa toscaneggiante. Esempi: «le tranquille / opre de' servi», «co' silenzi» (Leopardi, Le ricordanze, 18-19, 116); «Alle appendici forse de' giornali politici o a' placiti delle riviste?» (Carducci, Prose, 1). Da notare che il Manzoni accolse nella revisione linguistica del romanzo le forme articolate con apocope, in quanto proprie del fiorentino coevo (VITALE 1986: 36). Si tratta di una delle poche varianti che non riuscirono ad attecchire nell'italiano novecentesco (cfr. anche SERIANNI 1986b: 28-29).
However, these truncated forms are still alive in Tuscany: you can hear them in oral speech, specially in popular contexts1, and you can find preposition de', written in this way, in the names of some streets in Florence, for instance.
To summarise, de' is used instead of dei because this was the common form in Tuscany at the time Medici family attained political power. Notice that, at medieval times, it was a common habit to introduce Italian family names with a "preposizione articolata", in such a way that the name of a person had the structure "name" + "preposition di" + "definite masculine plural article" + "family name (in plural)". For instance, Dante Alighieri was called Durante degli Alighieri.
1. I've confirmed this with a Tuscan, who has told me that he uses the truncated forms of these prepositions in informal conversations with certain Tuscan friends.