Dyonic AdS black holes from magnetohydrodynamics