I'd like to know was Muawiyah the scribe of the Prophet and was there any contribution from his side to the compilation to of the Qur'an carried out by Uthman al-Affan?

Mu'awiya was not the writer of Wahi (revelation). He embraced Islam in the tenth year of the Hijra when revelation was complete. In fact he was the scribe who wrote letters. He caused immense trouble for the Holy Prophet. In the eighth year of the Hijra when Mecca was conquered and Abu Sufyan embraced Islam, Mu'awiya wrote many letters to his father railing at him because he had accepted Islam. When, however, the whole Arabian peninsula and beyond came under the influence of Islam, Mu'awiya was himself forced to embrace Islam. In doing so he lost all his prestige. Abbas then asked the Holy Prophet to assign Mu'awiya some position so that he might no longer feel humiliated. In view of the recommendation of his uncle, the Holy Prophet appointed him as scribe for the writing of letters. (Peshawar Nights page 529 Published by Yasin Publications)