Does the retina contribute in distinguishing lines and borders? I think there is a phenomenon behind the way which our eyes judge between lines of contrast, like black lines on a white page, by just recognizing the contrast areas at the level of the rods and cones. I don't understand how this phenomenon works in the retina.
Short answer
Yes, retinal circuitry enhances the perception of contrast.  

Background
In the retina, the neurons that guide the visual signal to the brain, the retinal ganglion cells (RGCs), process contrast. The receptive fields (RFs) of these cells exhibit a so-called center-surround organization (Fig. 1). They integrate the signal from multiple cones in the retina. ON RGCs fire when their RF is illuminated in the center (the central cone in the retina in the RF is illuminated) and they are inhibited when their surround is illuminated. OFF-center RGCs do the reverse. Together this organization results in sharpening of contrasts and aids in the coding of edges and contours. Midget cells also have RFs like this.

Remember that the retina is considered a part of the central nervous system by some. Thi because of its embryological origins, but also because of its complexity.

Note that further processing of contrast and edges occurs in the primary visual cortex (V1) (Schmolesky, 2002) and that awareness of that contrast information, i.e., the perception of edges, patterns and objects within the visual field occurs at high-tier associative cortices (Lorreys, 2005).


Center-surround RFs in RGCs. ON cells (left) fire when illuminated in the center, and are inhibited when illuminated in the surround. OFF cells have a reversed pattern (right). source: Stanford University 

References
- Lorreys, Trends Cogn Sci (2005); 9(12):556-9
- Schmolesky, Webvision, The Organization of the Retina and Visual System, Kolb et al. (eds). Utah University