why is it deleting my contacts when I just delete a text message from them?
Sounds like you aren't deleting a text message, you are deleting the text message. To delete a text, under messaging, press and hold on the persons texts you want to delete. Then when the meny pops up tap DELETE. That will delete the entire thread. If you just want to delete some messasges, tap on the thread, tap the trash can top right, and check box which ones you want to delete then tap delete.
Not sure what you are doing to delete your physical contact, but that shoudln't happen.