Prayer is the lifting up of our minds and hearts to God, to adore Him, to thank Him for His benefits, to ask His forgiveness, and to beg of Him all the graces we need whether for soul or body.
There are two kinds of prayer: Mental prayer, called meditation, in which we spend the time thinking of God or of one or more of the truths He has revealed, that by these thoughts we may be persuaded to lead holier lives;
Vocal prayer, in which we express these pious thoughts in words.
Writing when done with God in mind can be considered a form of prayer.