We present aperiodic multilayer structures with ultrabroadband near-perfect absorption in the visible and near-infrared wavelength range. We use a hybrid optimization algorithm coupled with the transfer-matrix method, to optimize both the material composition and the layer thicknesses of the aperiodic multilayer structures that are composed of infinite slabs of material above a semi-infinite substrate. In order to achieve ultrabroadband nearperfect absorption, we consider a broad range of materials including dielectrics, metals, and semiconductors. The optimization algorithms previously used to design ultrabroadband near-perfect absorbers only optimized the layer thicknesses of structures with fixed material composition. In contrast, we find that our approach of simultaneously optimizing the material composition as well as the layer thicknesses leads to structures with broader near-perfect absorption. For an optimized eleven-layer structure the lower and upper absorption band edges are 400 nm and ∼3800 nm, respectively. In addition, we find that, even though the structures are optimized for normally incident light, the absorption is high in a broad angular range within the wavelength range of interest. We also explain the physical origin of ultrabroadband absorption in these structures. Our results will contribute to the development of a new generation of devices for solar photovoltaics, imaging, and photodetection.