As a general thing, the agreement (that is, the lease) is between the landlord and tenant.
The agent is simply the landlord's intermediary.
So far as the validity of the lease is concerned, I'm pretty confident that you'll be OK.
How did you come to find out the agent was not licensed?