The functional role of contrast adaptation