Numerical construction of static and stationary black holes