Both magic realism and urban fantasy (as in "urban legend") focus on the merging of probabilities. Urban fantasy combines common, natural probability (as in Balzac, Dickens, Mann, and Chekov) with hypothetical probability, which posits an extraordinary but not impossible condition and draws conclusions from it. Many short stories of Horatio Alger exemplify this tendency. Magic realism, by contrast, goes much further, conjoining standard-issue realism with sheer impossibility, as in Gogol's "The Nose", where the protagonist sees his absentee proboscis richly dressed and praying in church.
Magic realism refers to literature that fuses both physical realities and psychological ones. It is "real" because it takes place in the real world. It is "magic" because it incorporates dreams, fantasies, and emotions as part of the real world.
Urban fantasy deals with stories that more specifically reflect elements of traditional fantasy novels - imaginary situations that are not scientifically probable, but that take place in real world settings.
The two genres are different, but you can see that the imaginary elements are somewhat similar. William Kennedy, who wrote Ironweed, is an American magic realist author.
Magical Realism (magic realism) refers to a movement in literature started by Latin American authors that combines literary subject matter, realism or a non-romantic view of the world, with speculaitve elements. In other words, it takes a realistic glance at the speculative phenomenon, while advancing literary stories (non-mainstream, non-plot driven, non-genre stories). Aimee Bender comes to mind as an American writing Magical Realism. If you read The Particular Sadness of Lemon Cake, you can see the vast difference between it and Fantasy novels.
Urban Fantasy is a subgenre of Contemporary Fantasy. It describes fiction that uses the common tropes found in Fantasy, but in contemporary times and in a real-world city or urban setting--sometimes referred to as urbanized fantasy. As with most Fantasy, UF is plot driven and places vast importance on its speculative elements. In this sense, it has more in common with Comic Books than with Magical Realism. It is very rare for an Urban Fantasy novel to not be plot driven.
Magical Realism and Urban Fantasy are worlds apart. Their labels are not interchangeable in any way, even while they share some similarities. One is literary and the other is genre fiction--I hope you know what both mean.