The best aperture is where the lens gets diffraction limited. With the very best lenses that may happen at f/5.6 or even at f/4. Some lenses achieve optimum performance at large apertures, without being limited by diffraction. Those lenses will maintain performance stopping down until diffraction limit is met. There are very few photographic lenses that are diffraction limited at f/4. my guess would be one or two telephoto lenses for the Leica R, the Coastal Optics 60/4.0 Macro lens and possibly some of the Canon L-series telephoto lenses.
I don't think this is quite true, but perhaps that depends on one's definition of 'diffration limitation'.
As I understand the term, a lens is diffraction limited at a particular aperture when no amount of improvement by the lens designer and manufacturer could reveal any additional sharpness, simply because one cannot defeat the laws of diffraction. But it's interesting that physics research departments are trying very hard to defeat the laws of diffraction through the development of artificial materials, produced by nanotechnology, which have a negative refractive index, and could theoretically make it possible, eventually, to develop a camera lens which is as sharp at F22 as a good quality lens currently is at F5.6.
In practice, the effects of diffraction are present at all apertures in all lenses, but at larger apertures, say as F1.4 to F5.6, such effects are overshadowed by other lens aberrations which are the main obstacle to improving the lens sharpness.
If a lens is sharpest at F4, that doesn't mean the lens is diffraction limited at F4. I'd be very surprised if any 35mm-format lens exists which is diffraction limited at F4. Maybe certain very small-format lenses designed for P&S cameras can be diffraction limited at F4. Maybe microscope lenses can be diffraction limited at F4 or wider. I'm not sure about that.
Again, as I understand the situation, most DSLR camera lenses would not be diffraction limited till F11 and beyond, the apertures at which all lenses are equally bad.
ps. One also sometimes finds that a particular telephoto lens which is impressively sharp at F2.8 is only very marginally sharper at F2.8 than it is at F8. Furthermore, its sharpness at F8 may not be as great as the sharpness of other less impressive lenses at F8. In other words, the lens has been optimised for maximum sharpness at F2.8, with a trade-off of being slightly less sharp than it could be at physically smaller apertures.