Heavy flavour in nucleus-nucleus collisions at RHIC and LHC: a Langevin approach