Generally speaking, law overrides contract terms. If the ICANN contract requires the other party to do something illegal then surely that clause would be unenforceable.
Now let's think about the more complicated aspects: if an EU citizen registers a domain with a non-EU registrar is that registrar obliged to follow EU legislation? If so how does the EU bring the registrar to account if it has no EU residency and how does the registrar discover that citizenship of the registrant?