If you are not in the studio with the artist, and tellling them how to make the song, you are the composer.
Music used in a song is the composition. So the person who made the beat is actually the composer, not the producer. That's why when you register a song using a performing rights organization( BMI or ASCAP) they ask about the composer (beatmaker), not the producer.
The producer is actually the person who helps the artist and engineer, structure the song, and sometimes is involved in financing the project. They usually have the final say in the direction of the song. Producers profits are usually %'s of the Master recording.
The composer / beatmaker on the other hand, makes profits off the publishing of the songs performance. Not the same thing, but most ppl still call beat makers / composers the producers, which is why publishing is so confusing to alot of people.