I've searched and I've searched, but there doesn't seem to be any indication of what Ned was actually going to write, or if he even ended-up writing the letter in the end.
Letter to his wife
Ned and Catelyn were not initially in love, or determined to get married. However, after the passing of Brandon Stark - who was betrothed to Cat - Ned was honour-bound to follow through with the betrothal and they married.
This however did not stop them from growing fond of each other and eventually loving each other. As such, one possibility is that Ned wanted to write a letter to his wife, having not seen or heard from her in a while.
Letter to his son (Robb)
Robb being Ned's heir and current head1 of Winterfell and House Stark, Ned needs to inform him at least one last time of all of the important things which Robb needs to consider, i.e.:
- Robert left no legitimate heirs
- Arya and Sansa captive, possibly in peril
- Don't trust Littlefinger
- Don't trust Varys
- Don't trust anyone
- Don't trust Littlefinger
Letter to Howland Reed
This is pretty much Ned's escape plan. Howland Reed is a mysterious character at best, and has been known to possess at least some magic or trickery, he also knows some interesting things2. Ned could have written to Howland explaining his current position and could have either asked for assistance, or let Howland know that he is on his own with the whole aftermath of the Tower of Joy saga.
Letter to Jon Snow
This seems to be everyone's favourite possibility. We want to see at least some proof of Jon's parentage. What a shame if Ned takes this humongous secret to his grave! In the show, Ned even promises Jon that he will tell him of his mother when they meet next - right in the feels!
For me, this is the most improbable; something so big and game-changing would not have been put in a letter. Although, this could be why Ned didn't end up writing the letter, knowing that Varys was going to read it!
Letter to Yoren
This one is my personal favourite possibility. Yoren seems to be very conveniently present at Baelor's Sept to rescue Arya; why? what's his purpose for being there?
I Asked this question on the Westeros.org forums to see if we can get a better response. Here is a breakdown of my favourite possibility.
User BigReadEyes writes:
I think the answer is in AGOT chapter 58 or Eddard XV. Varys in disguise visits Ned in the dungeon. Varys tells Ned that Arya escaped and fled & that Sansa has pleaded that Ned’s life be spared.
Varys drops the bomb:
“I trust you realize that you are a dead man, Lord Eddard.”
I interpret that to mean that it does not matter what Ned does or does not do, Ned is a dead man.
The two carry on their conversation. Eddard asks
Would you at least consent to carry a message out for me? “That would depend on the message. I will gladly provide you with paper and ink, if you like. And when you have written what you will, I will take the letter and read it, and deliver it or not, as best serves my own ends.”
The conversation continues. Varys says on the morrow Cersei will visit […]
“So what is your answer, Lord Eddard? Give me your word that you’ll tell the queen what she wants to hear when she comes calling.”
Ned is not willing to do that until Varys brings Sansa into the conversation with the insinuation of threat against her life.
“Surely you did not think I’d forgotten about your sweet innocent, my lord? The queen most certainly has not."
I assumed that Ned was actually going to be given the chance to take the Black. I was wrong. He was a dead man. Taking the Black was a farce. Varys confirmed it. Insinuating that if Eddard admitted to being a traitor Ned could save Sansa.
[…]Yoren grabs Arya. Ned is beheaded. Then in ACOK chapter 1 or Ayra I Yoren tells her:
“Here’s something you don’t know. It wasn’t supposed to happen like it did. I was set to leave, wagons bought and loaded, and a man comes with a boy for me and a purse of coin, and a message, never mind who it’s from. Lord Eddard is to take the Black, he says to me, wait, he will being going with you. Why do you think I was there? Only something went queer."
I think that Eddard decided to send a message to Yoren that the accusations of treason were false, along with a bit of other information. I think that Eddard’s message to Yoren served Varys’ purpose.
This to me seems like the most plausible scenario, Ned is most worried about his unsafe daughters, and would probably have wanted them to be as safe as possible. At this point, all of the Northmen he'd brought with him were either dead or missing, so Yoren was his only choice.
1. Robb at this point is the current heir, because regardless of Ned's outcome: he either confesses his "treason" and gets sent to The Wall, or dies; either way, he has lost his title as Head of House Stark.
2. Did anyone beside Ned and Howland Reed survive at the Tower of Joy?