Those accompanying Paul stood speechless, they heard the voice but did not see anyone.
Those accompanying Paul did see the light, but they did not hear the voice of him who spoke to Paul.
The apparent contradiction between these two scriptures is resolved when we carefully observe the Greek text and consider the context of each passage.
In the English text we read of them " hearing a voice" and "they heard not the voice". In both cases the word "hear" is followed by the noun "voice" in the accusative case (what did [did not] they hear?). In the Greek text there is a difference in these two places: In Acts 9:7 the word for "hear" [akouo] is followed by the word "voice" [phones] in the genitive case; but in Acts 22:9 the word for "hear" [akouo] is followed by the word "voice" [phonen] in the acusative case. In the Greek language there is a linguistic and grammatical difference between the "hearing of a voice", i.e. the sound or noise (with the genitive case); and "the hearing of a voice", i.e. hearing and understanding the actual content of the words, the matter spoken (with the accusative case).
Those who accompanied Paul heard, just as Paul himself did, the sound, the noise of a voice. But only Paul heard the actual words, i.e. only he understood what was said to him; the men who were with him did not hear what Paul was told in this vision. When considering the context this becomes evident as well. The men with Paul heard something which Paul also heard, but they did not hear (i.e. understand) what Paul was told by this voice.