Imperial, but i'm a little bit biased.
Both have excellent teaching hospitals, and are consistently highly ranked in league tables.
A key difference between the courses is that at UCL you would do your intercalated BSc in the 3rd year, whereas at Imperial it's in the 4th year. The 3rd year at Imperial is entirely clinical (hospital-based) which in my opinion would give you a feel for what aspects of medicine you enjoy and would be keen to study in depth in your BSc year, whereas at UCL you wouldn't have that insight.