We present the results of a search for clustering among the highest energy events detected by the surface detector of the Pierre Auger Observatory between 1 January 2004 and 31 August 2007. We analyse the autocorrelation function, in which the number of pairs with angular separation within a given angle is compared with the expectation from an isotropic distribution. Performing a scan in energy above 30 EeV and in angles smaller than 30 degrees, the most significant excess of pairs appears for E > 57 EeV and for a wide range of separation angles, between 9 and 22 degrees. An excess like this has a chance probability of about 2% to arise from an isotropic distribution and appears at the same energy threshold at which the Pierre Auger Observatory has reported a correlation of the arrival directions of cosmic rays with nearby astrophysical objects.