Much critical analysis has been done with the whole sonnet sequence, and while there are no definitive answers, an interesting theory is that he is writing what we know as the first 75+ sonnets in praise of a young man, perhaps someone who had commissioned him to write the sonnets in praise of him. If this is true, then sonnet 18 is a flattering poem about the young man, but is ultimately a poem in praise of the poet's talents. While the young man's "eternal summer shall not fade," it is because the poet's words will live on for future generations to read in this poem.
Specifically whom is not clear. The convention at the time was for a poet to write a sequence of sonnets to a beloved; for many poets the person of their affections was known, but not so in Shakespeare's case:
It is thus ironic that the object of Shakespeare’s own sequence should be unknown. The poems themselves range over many topics, including the beauty and desirability of marriage for a young man, a love triangle, a “dark lady,” and several philosophical and moral problems.
Whomever he is addresssing, what is clear is that he's imparting a bit of elder advice to a younger person - while young, in the time of beauty, procreate, your descendants being what transcend death and make you immortal.
In Sonnet 18 Shakespeare addresses his own immortal soul, alluded to in the ascription to him of having an "eternall Sommer," being forever young and alive. The poet seeks to make this true on earth as well by his praise of him "in eternall lines to time," lines which will keep the sense of him alive and vital on earth as long as there are people to read of them in this sonnet.
If this view seems outlandish, also outlandish will appear the view that the mysterious "dark lady" is none other than his lower soul, the part of man that seeks the fulfillment and gratification of man's human, physical nature -- the perishable part of him. Since the poet craves to ascend spiritually, he is chagrined that his lower soul again and again pulls him down to earth -- the very human condition celebrated throughout the sonnets.
Both sides are necessary for if we seek only our physical gratification, we become as beasts. But, likewise, if we aspire too high spiritually, we fail to reproduce (as in the 17 earlier sonnets) or to protect our human selves. Shakespeare regards both personifications in his sonnets as "angel's" and "friends" -- see Sonnet 144 -- and a well lived life as a coming to a balance between these two aspirations.