If they are using the data for a background check or they want you to list all periods of employment without any gaps, then exact company names and dates will be required. You usually see this when they ask you to complete an application or background check form.
If they want exact complete information, then you would treat this as two jobs. You had different employers. You have to be exact because the employment background check will be confirming the dates you were an employee. HR doesn't have any information when you were contracted to do work an contract, they only know when you were an employee.
On the resume you have the ability to be less exact. You could allude to the nature of the first few months by saying it started as a contract-to-hire.
Now if you worked for multiple contracts while working for the staffing company you may have to specifically list the company on the resume if you did work that you want to mention in the resume. You also may have to mention the staffing contract if you are trying to show continuous employment.