Replacing the wp-admin and wp-content folders from a fresh install solved the error (although I still have no idea what caused it).