What does TRWP backup include? If I would take a backup via TRWP, does it include all my apps, app data, messages, contacts or it would just take backup of the ROM only, so I could get a fresh ROM with factory restored when I restore it ?
To my knowledge, TWRP does a nandroid backup. As you can read in the tag wikis of the mentioned tags (nandroid, backup), a Nandroid backup takes images of your partitions. It's not a backup on the file level, but on partition level. So it includes everything stored on those partitions. Doing a full Nandroid backup of your system thus includes the entire system, one file per partition. There are only very few things not contained, such as the radio-firmware.

So to put it as a short direct answer to your question: Yes, a full Nandroid backup would include all your apps, app data, messages, contacts.

Though it might be complicated to extract them separately (Nandroid can't do that, it's always an "all-or-nothing". But e.g. Titanium Backup can read data from Nandroid backups. Just in case you'll need that :)