TextEdit.app/Contents/Info.plist
Open in a text editor, search for one of the icon file names that's already supported, should be pretty self-explanatory what to copy/paste to add a new one.
BE SURE TO KEEP A BACKUP, YOU'LL ALMOST CERTAINLY SCREW IT UP AT LEAST ONCE!!!