Melchizedek, also known as the King of Salem, contributes to Santiago's journey in The Alchemist by teaching the boy to learn about himself, to find the right path and to learn to be wise. The King of Salem helps Santiago understand that what people most want is to learn their personal Legends, the idea about themselves that is most true and to which they must stay attuned and committed. He also contributes to Santiago's journey by giving hints and clues as to where to find his treasure. In addition, he teaches Santiago to be wise by making a deal with him to trade one-tenth of his sheep for Malchizedek's clue to the treasure.
In the book “The Alchemist” a boy, Santiago, has a dream about a treasure and goes on a quest to find it. He is a shepard boy who sells his flock to get money for the quest. On his journey he meets the King of Salem in Tarifa. The king explains to Santiago to go on the quest and to follow his dreams. He lets him know that it is his destiny. He stresses the importance of following one’s dreams. The kings name is Melchizedek. He informs Santiago about appears to Santiago in the town square of Tarifa, where he tells Santiago about the Soul of the World and of the concept of a Personal Legend. He is wearing a cloak of gold with stones. Two of them are magical and he gives the magical stones, Urim and Thummim, to Santiago. By giving him the stones, he is helping Santiago as well as having provided him with the encouragement to continue his quest.
The other answers in this thread more or less explain the significance of the character Melchisedek in the "The Alchemist" but you may still be wondering why Paulo Coelho included this character in the story. It is because of the alchemy theme. Melchisedek is a significant figure in the Kabalistic tradition (which alchemy finds its roots in). According to Rabbinical tradition he is either the same person as Shem, the son of Noah and a high priest, or a contemporary. Another, alternative teaching is that he is a manifestation of divinity itself, in the form of a man. In the alchemical tradition he is a man in his highest form; manifesting divinity. There are references to him in the Midrash, Zohar, and Tanakh (traditional Jewish books of Kabalistic value), but you might be more familiar with references in the Bible: Genesis 14:18 and Hebrews 7:1. Melchisedek, as a high priest, blesses Abraham upon his victorious return from battle against the four kings who had beseiged the cities of Sodom and Gamorrah and who had taken Abraham's nephew Lot prisoner. He brings bread and wine (the products of the earth) to Abraham and blesses him in the name of "God Most High, Creator of heaven and earth" (the blessing is the product of heaven and completes the formula). In return, Abraham gives a tenth of the spoils of battle. This is the reason Coelho's character requires a tenth of the boys possessions and the fortune teller makes the boy promise a tenth of the treasure he seeks. Coelho has woven a tale firmly rooted in the study of alchemy but has brought this dead system to life with his assertion that the universe conspires to help those who pursue their personal legend.
El Corazon del Ceilo