What should I write in an email to a professor who encouraged me to apply after applying for the Ph.D. program? I want to ask him to advocate my application in the admission committee. But, I am not sure how I can do that.
Notice that pretty much 95% of the time the faculty "encourage" applicants to submit an application, unless it's an obvious bad fit. This is to say, if he says "don't apply," it'd be a strong evidence not to; but if he says "please apply," its meaning can range from neutral to highly positive.
A less risky way to partially achieve your goal is by setting up an environment for that conversation between the committee and the professor to happen without asking the professor to do so. One usual way to do that is: i) contact the said professor and ask if you can mention his name in your personal statement; and if yes, then ii) in your personal statement, mention that:
... the conversation with Prof. So-and-so was very encouraging and reinforced my desire to study in this program,
or anything along that line. Don't exaggerate, don't write anything that's untrue. If the committee does need extra input, they may approach the faculty member.
Let's say, you submitted the package already without doing the above, then the best you can do right now is to contact the professor and i) thank him for the time and encouragement, and ii) tell him that you have submitted an application, and that your desire to enter the program remains very strong. That's it. Do not ask for any favor as this behavior can be viewed negatively. If you truly did leave a strong impression, the faculty member may mention your portfolio to the committee.
And lastly, don't feel despair if this does not happen. An individual faculty member's input rarely makes/breaks the deal. One of such possibilities is if you're financially sponsored by the person (Aka, if he has a lab and a grant to fund your study, then his recommendation is essential.) In other cases, I'd guess most of the decision would still be based on your academic records and research-related experience.