I remember meeting a priest from Rome who described himself as a [missing word here] which he defined as one who writes prayers. I cannot for the life of me recall or find this word, and I'm starting to wonder if perhaps he coined it or borrowed it from another language.
A specialist in formal worship, i.e. the liturgy, is a liturgist. Understand, however, that this is a very broad term that is used differently in various traditions and denominations, and that the writing of prayers is only one of a liturgist's responsibilities.
In mainline Protestantism, a liturgist is typically a lay minister who helps to organize worship services. But in Catholicism and the high church, especially above the parochial level, a liturgist is a cleric whose role may include the composition of prayers as well as choosing hymns, existing prayers, and other variable aspects of a religious ceremony.