You can be charged based on being in the car where the illegal drugs were found. A suspicion about the appearance of the person as it compared to a report of possible criminal conduct has been held to justify a legal search that does not offend the Fourth Amendment.
I suggest you retain criminal defense counsel.
Possession has two forms: actual possession and constructive possession. You were cited under a constructive possession theory. Constructive possession requires that the government show that you had the ability to exercise dominion and control over the marijuana. You are fortunate to have been cited civilly, as the common practice for many police agencies after possession of under 1oz of marijuana was decriminalized is to charge person with possession with intent to distribute, regardless of whether they can hope to prove intent to distribute. That being said, the worst case scenario if you contest the citation and lose the fine that you would have had to pay if you didn't contest the citation.
As for a clerk's hearing contesting whether or not you were in "possession" of the marijuana and any possibly illegal search, the clerk will not likely care that the search may have been illegal, instead focusing on whether or not you possessed the marijuana. If you were charged criminally, then a motion to suppress arguing that the search was illegal would be appropriate, but any argument you can make for suppression will have limited benefit at a clerk's hearing.
If the police officer saw some typr of contraband in the car and it was in what is called "plain view" the police officer may search the car. If the officer smelt something in the car that could lead to a valid search. Once the officer searches the car and if finds something he can then charge the person he believed was in possession of the item.
If you wanted a lawyer to represent you at the hearing it is going to cost more than $100.