You should have contacted the journal office or the editor-in-chief or other members of the editorial board. You have not mentioned who these professors are and how they can find out if the journal has received your paper. However, you have taken the wrong route of communication. Any form of communication should be done directly with the journal, and not through someone else.
Having said that, I don't think you need to withdraw your paper because of this. As long as you do not contact those professors again, it is fine. Confidentiality is very important in the peer review process, and it will be unethical if you contact the professors even after knowing that they might be peer reviewing for the journal.