Now it's easy to say that under the pretense of "Magneto bends metal therefore he beats Ultron", but when you factor in the kind of stunts they've pulled in comics? I doubt it.
If Iron Man can last against Magneto by building even the most basic defenses, I'm sure that someone like Ultron, who Stark attributes as possessing superior intellect, could easily find a way to stand against Magneto. This is the same robot that survived being blown up inside a star when his entire body was completely destroyed. This is the same robot that the heroes of the Marvel U had to practically to BEG to lose, otherwise its constant victories could break the entirety of reality/time/space.
Again, easy to throw around the "Magneto manipulates metal", but Ultron isn't just a piece of scrap metal. Ultron is something that Stark has continually described as being smarter than him and many others, to the point that he's literally been described as Earth's greatest evil (I'm not kidding) and has since been fighting it out with cosmic-tier heroes in his most recent appearances.
If we're talking about the movies, well then that's still unknown territory, but in the comics? Ultron is pretty damn tough.