You don't know that it's only in your head. It may be in his head, too. Before this goes any further, you need to stop the texting/messaging. Nothing good can come of this and if your husband should find out, it could be very bad.
It doesn't matter that your husband has drawn up a separation agreement and stopped wearing his wedding ring. You have made the decision, at this point, to stay in the marriage. If you want to separate from your husband, then do that before starting an online/telephone relationship with another man.