I'd like to think Ultron with his molecular rearranger could somewhat counter Magneto's control over adamantium. But I would be easily convinced otherwise with proof if anybody has any.
Ultron should be able to protect both his insides and his adamantium using his molecular arranger and his forcefield, he could probably shift his forcefield so Magneto cannot control it either, so this may go to war of attrition in which Ultron should win in the end.
Going with Magneto here. Weve already seen him control pure adamantium, and being that Ultrons matter rearranger is surely metal, I dont see it lasting too long to protect him from Mags' power.
Ultron would likely sh_t on Magneto on a comic, he's just written that way. If you think Magneto can overcome his defenses, be my guest, he certainly has a powerset that could pass through them.
Of course, Ultron never battles characters who can control all metal, adamantium included. I love Ultron, I think he would hand Thor, Cap, Iron Man and so on Avengers their butts, but Magneto and his power set just has Ulties number.
If ironman can last against mags then Ultron will stomp. Ultron is smarter than tony.
And you can't take prep away from Ultron when the current Ultron is attacking from the future. I mean you can take it away, it's just not going to do any good as time is meaningless to him currently.
__________________
You believe you are dealing with a mere mortal? Foolish is the man who knows not when a god stands before him...