After a few attempts I have managed to install Windows 8, but the freezing continues. It is freezing exactly as it was freezing during the boot time. I have tried also to disable the dynamic ticking but the computer still freezes randomly. Is this a known issue?
I think I have found the problem, I almost forgot about it and I did not even mentioned it here, I had also a TP-Link TL-WN851ND card in the PCI socket. As soon as I removed the card the installation went flawlessly. It seems that this card is causing Windows 8 freezing. If someone encounters Windows 8 freezing it should try to remove any Wi-Fi adapter and see how it goes. Looks like a Windows bug, as the OS should not hang.