Alright, my suggestion is this.
Take off the kid gloves. Rather than worrying about whether an 18th level Lich sans Magic Items is an appropriate challenge for your PCs, worry about what your hyper intelligent, thoroughly immoral, and fully equipped 18th Level Lich Wizard can do your PCs.
Not every encounter in D&D need end in death and destruction.
The PCs need something from the Lich's castle. The Lich likely has said someone about for a reason. Using Project Image in conjunction with cleverly placed arrowslits/murder holes/peep holes, the Lich can converse with the party with relative impunity. Be logical, be concise, and be honest with the party.
'Hold a moment. This is merely an illusion for the purpose of conversation. I come to parlay, not to destroy.
'Yes, I understand that as a well equipped adventuring band, likely with good aligned clerics or even Paladins, several of you may be intent on destroying me. Some of you may just be bloodthirsty or just plain greedy, and hope that the destruction of my physical form will leave you with both power and riches.
'And you know, you just might be able to pull it off. Your warriors look to have mighty thews, your casters seem well educated, and the sneaky one looks particularly devious. However, please keep in mind that I'm terribly clever, and the lot of you are in my home, which I've designed to minimize any chance of a fair fight. I'm skilled enough of a Necromancer to ensure my own unlife, and have survived a dozen assasination attempts from my own peers, much less a band of adventurers, whom as far as I can tell weren't prepared to confront a Lich this day.
'So, while I'm fairly confident that I could destroy the lot of you and raise you as my Undead minions, I'd just as soon work out some sort of amiable compromise that will allow me to return to my research, and the lot of you to return to your no doubt fascinating adventures.
'Now, if you'd be so kind to mention just why you're disturbing my research?'
Turn a potentially lethal encounter into a chance for diplomacy. Your party might not take the opportunity, but at least you won't need feel guilty if the encounter turns into a TPK.
Not to say this encounter is without teeth. The Lich may not want to relinquish the prize they seek, at least, not without some sort of service. Perhaps he has a rival that he wishes destroyed. Another powerful undead or evil priest whom the Liche doesn't feel confident outliving.
I'd also suggest making the Lich lawful and honorable. He may be evil, but he'll keep his word. Just for a little extra grey in the morality stew.