The simulation of electrons moving in periodic potentials exposed to large magnetic fields with ultracold atoms in optical lattices has motivated several successful experimental works about the realization of uniform artificial magnetic fields. One main challenge in this context is the implementation of experimental probes revealing the non-trivial topology of energy bands. Here I report about direct measurements of the transverse Hall deflection of ultracold bosonic atoms in artificially generated Hofstadter bands. In combination with the measured occupation of the different Hofstadter bands we were able to obtain an experimental value for the Chern number of the lowest band with good precision. This result constitutes the first Chern-number measurement in a non-electronic system. The artificial magnetic field was generated using a new all-optical technique, which enables flux rectification in a staggered optical superlattice based on laser-assisted tunneling.