Well seeing as the OP didn't ask about the Moto X and was only asking about the SGS3 and Xperia Z, I'll actually help the OP out:
OP, I'd personally go with the Xperia Z. It has a slightly larger screen (5" vs 4.8") at 1080p resolution (compared to the 720p resolution of the SGS3). The Xperia Z I believe has the better camera and also faster processor, but more importantly, cleaner UI which leads to a faster performing phone. The Galaxy S3 certainly isn't the fastest performing phone, and when I used to own it, it would consistently lag and stutter across the UI and in apps. The Xperia Z is a faster device to use, but also had stutter issues here and there.
On the build of the phone, the Xperia Z was the beginning of Sony's latest design language for their devices. It has a glass back and front (so you may want to be a little careful) with I think plastic sides. The Galaxy S3 is plastic all around and not water proof.
UI of the phone is a more personal choice, with the SGS3 having more brighter/slightly cartooney icons/design and the Xperia Z having a more focused, cleaner UI.
A lot of it is just personal opinion (as far as UI and design and all that), but on specs alone, the Xperia Z is the newer, and more powerful device. I also think it is the better device.
Your best bet would be to try both at a store and see which one you like more.