We can see that the library is not too dark to search for books, so why did Harry Potter need a lamp here?
The script indicates that the part of the library he's in is 'pitch black' without the lamp.
INT. LIBRARY – NIGHT
[Pitch black. A match STRIKES, floats by itself, in midair. It drifts forward, LIGHTS a LAMP.]
INT. LIBRARY - ROW OF BOOKS - MOMENTS LATER – NIGHT
[The lamp floats eerily among the books, then rises, illuminates a SIGN: RESTRICTED.]
INT. RESTRICTED ROOM - LIBRARY – NIGHT
[The lamp FLOATS into the room, the invisibility cloak drops and, bit by bit, HARRY appears.]
Obviously in movies you can't have pitch blackness (or the audience will think the projector is broken) so you have 'Hollywood darkness', where the audience can see perfectly well, but recognise that the actors can't.
This ties in very nicely with the description of the library (at night) from the source novel.
The library was pitch black and very eerie. Harry lit a lamp to see his way along the rows of books. The lamp looked as if it was floating along in mid-air, and even though Harry could feel his arm supporting it, the sight gave him the creeps.
The Restricted Section was right at the back of the library. Stepping carefully over the rope that separated these books from the rest of the library, he held up his lamp to read the titles.
-Harry Potter and the Sorcerer's Stone, Chapter 12
Light enough to not bump into bookshelves and see the outlines of individual books is not the same as light enough to read worn and cracked titles on book bindings from a distance of two or three feet.
During the 1991-92 school year when Harry first entered the Restricted Section via his invisibility cloak during the Christmas holiday, he was in a huge hurry, given that no one but Madam Pince was allowed in that section without the written permission of a professor. Being able to see titles from a few feet away made for much easier (and thus quicker) searching for a book about Nicolas Flamel.
One possible explanation is in the mechanism of Scotopic (low light) Vision and how it impacts text. In low-light conditions, the human eye emphasizes the use of the rods, which are clustered more toward to edges of the eyes over cones, which are concentrated in the center. This is one of the reasons why it's easier to see things out of the corner of your eye when it's dark, and it unfortunately also means that the area where you best focus, the center of the eye, is relatively unused, which makes it that much harder to read text. Adding to that, Harry has poor vision to start with, and glasses, particularly cheap glasses that the Dursleys are likely to buy him, prioritize correcting the vision straight ahead, with vision toward the sides getting progressively more distorted. This can be heightened if he has some forms of astigmatism, which further tend to blur text. Thus, in a low-light situation, he's going to have more difficulty reading the books, even if he has enough light to navigate the room.
Reading in low light is hard.
It's been well-studied that lighting levels affect reading speed. Reading poorly illuminated text is more difficult, more time consuming, and more error-prone than reading text that is well-lit. If you're searching a library for particular text, you'll find it faster when using a lamp, rather than struggling to make out the titles in dim light. Even if it wouldn't have been impossible to read the titles without the lamp, it would have certainly been more difficult.